<template>
  <div class="inputCtx">
    <el-select v-model="value" clearable placeholder="请选择" v-bind="$attrs">
      <el-option
        v-for="item in $attrs.options"
        :key="item.value"
        :label="item.label"
        :value="item.value"
      >
      </el-option>
    </el-select>
    <el-button @click="clearClick" style="margin-left: 10px">清除</el-button>
    <el-button @click="confirmClick">确认</el-button>
  </div>
</template>

<script>
import mixins from "./mixins.js";
export default {
  mixins: [mixins],
  data() {
    return {
      value: "",
    };
  },
  methods: {
    clearClick() {
      this.value = "";
      this.updateValue();
    },
    confirmClick() {
      this.updateFilter(this.value);
      this.updateValue(this.value);
      this.closePopover();
    },
  },
};
</script>

<style scoped lang="less">
.inputCtx {
  display: flex;
  .el-select {
    width: 100%;
  }
}
</style>
